package TCP.Test2;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;

public class Send {
    public static void main(String[] args) throws IOException, InterruptedException {
        Socket socket = new Socket("127.0.0.1",10086);

        OutputStream outputStream = socket.getOutputStream();


        outputStream.write("你瞅啥".getBytes());

        socket.shutdownOutput();

        InputStreamReader inputStreamReader = new InputStreamReader(socket.getInputStream());
        int b;
        while ((b=inputStreamReader.read())!=-1){
            System.out.println((char) b);
            Thread.sleep(500);
        }
        socket.close();


    }
}
